
function loadmap() {
        var map = new GMap2(document.getElementById("map"));//khai bao diem trung tam khu vuc load ve
		//map.setMapType(G_SATELLITE_MAP);	//set loai ban do : G_SATELLITE_MAP,G_NORMAL_MAP,G_HYBRID_MAP,G_DEFAULT_MAP_TYPES
		map.addControl(new GLargeMapControl());// add thanh control zoom size tren ban do
		//map.setMapType(G_NORMAL_MAP);
		//map.setMapType(G_HYBRID_MAP);
		//map.setMapType(G_DEFAULT_MAP_TYPES);
		//google.load("maps", "2");
        map.setCenter(new GLatLng(21.022502, 105.846062), 13);//diem trung tam co toa do khai bao trong GLatLng(),13 la do zoom cua ban do
		// Create our "tiny" marker icon
		var blueIcon = new GIcon(G_DEFAULT_ICON);
		blueIcon.image = "/blue-dot.png";                
// Set up our GMarkerOptions object
		markerOptions = { icon:blueIcon };

	//	var myGeographicCoordinates = new GLatLng(myLatitude, myLongitude)
		var message = ["Nha so 1","Nha so 2","Nha so 3","Nha so 4","Nha so 5","Nha so 6","Nha so 7","Nha so 8","Nha so 9","Nha so 10"];
		function createMarker(latlng, number) {
      		var marker = new GMarker(latlng);
      		marker.value = number;
      		GEvent.addListener(marker,"click", 
			function() {
				//map.setCenter(latlng, 13);
        		var myHtml = "<b>#" + number + "</b><br/>" + message[number -1]+"<br/> Toa do"+latlng.toString();
        		map.openInfoWindowHtml(latlng, myHtml);
      		});
      		return marker;
		}
	// Add 10 markers to the map at random locations	  
		var bounds = map.getBounds();	//get khung ban do
  		var southWest = bounds.getSouthWest(); // 
	  	var northEast = bounds.getNorthEast();
  		var lngSpan = northEast.lng() - southWest.lng();  //get chieu dai theo kinh do
  		var latSpan = northEast.lat() - southWest.lat();  //get chieu dai theo vi do
  		for (var i = 0; i < 10; i++) {
    	    var point = new GLatLng(southWest.lat() + latSpan * Math.random(),
       		southWest.lng() + lngSpan * Math.random());
    		map.addOverlay(createMarker(point,i+1)); // add nhieu diem cung luc'
		}
}

